#pragma once;

#include "Material.h"
#include "Vector3.h"
#include "Random.h"

class  Lambertain :public Material
{
public:
	Vector3 albedo;

	Lambertain(const Vector3& a) :
		albedo(a)
	{
	}

	virtual bool scatter(const Ray& r_in, const HitRecord& rec, Vector3& attenuation, Ray& scattered) const
	{
		Vector3 target = rec.p + rec.normal + random_in_unit_sphere();
		scattered = Ray(rec.p, target - rec.p);
		attenuation = albedo;
		return true;
	}



};

